# !usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:张广勤
@Web site: https://www.tunan.wang
@Github:www.github.com
 
@File:handlemulu.py
@Time:2022/3/3 10:01

@Motto:不积跬步无以至千里，不积小流无以成江海！
"""


with open('mulu.csv', 'r', encoding='u8') as f:
    lines = f.readlines()
    print(lines)
zq = []
items = []
for item in lines:
    #print(item)
    #print(type(item))
    item=item.split(',')#字符串转列表
    #print(item)
    #print(type(item))
    items.append(item)
    #print(items)
    #print(type(items))
    #print(len(items))

for i in range(len(items)):
    #print(items[i][1])
    zq.append(items[i][1])
#print(zq)
zq=list(set(zq))
print(zq)


with open('mulu.csv', 'r', encoding='u8') as f:
    lines = f.readlines()
    for yjn in zq:
        bblist=[]
        for item in lines:
            # print(item)
            # print(type(item))
            item = item.split(',')  # 字符串转列表
            #print(item)

            # if item[1]==zq[0]:
            #     print(item)
            # elif item[1] == zq[1]:
            #     print(item)
            # elif item[1] == zq[2]:
            #     print(item)
            if item[1] == yjn:
                print(item)
                bblist.append(item[2])
        print(bblist)#print()打印语句的位置一定要注意
        print('@'*50)









